#ifndef SHOWFONT_H
#define SHOWFONT_H

#define getColor(a, b, c, d) (a|b<<8|c<<16|d<<24)//RGBA8888格式颜色值
#define RGBESL(r, g, b, e, s, l) ((r << 24) |(g << 16) | (b << 8) |(e << 4) |s |(l<<24))


extern "C"
{
    #include"font.h"
}
#include"lcd.h"

class ShowFont
{
public:
    enum Color
    {
        red    = 0x00FF0000,        /* 红色 */
        bule   = 0x000000FF,        /* 蓝色 */
        Lime   = 0x0000FF00,        /* 酸橙色(绿) */
        white  = 0x00FFFFFF,        /* 白色 */
        purple = 0x513b7c,          /* 紫色 */
        yellow = 0x00FFFF00,        /* 黄色 */
        khaki  = 0x00F0E68C,        /* 卡其布色 */
        gold   = 0x00FFD700,        /* 金色 */
        chocolate = 0x00D2691E,     /* 巧克力色 */
        tomato = 0x00FF6347,        /* 番茄色 */
        black  = 0x00000000,        /* 黑色 */
        darkSeaGreen = 0x008FBC8F,  /* 深海洋绿 */
        oliveDrab = 0x00556B2F,     /* 橄榄土褐色 */
        darkSlateGray = 0x002F4F4F  /* 深石板灰 */
    };

private:
    struct LcdDevice *lcd;
    static ShowFont* m_instance;



public:
    ~ShowFont();

    int display(char* buf, int pixelsize,int backgroundWidth,int backgroundHeight,int backgroundColor,int fontColor,int posXToLcd,int posYToLcd);

    void font_show(struct LcdDevice *lcd,char*text,int pixelsize,int backgroundWidth,int backgroundHeight,int backgroundColor,int fontColor,int posXToLcd,int posYToLcd);


    static ShowFont* instance();

private:
    ShowFont();


};

#endif // SHOWFONT_H
